<template>
	<view class="nearby-store-goods">
		<scroll-view scroll-y @scrolltolower="$emit('getData')" lower-threshold="60">
			<view class="nearby-store-goods__item bg-white e-flex" v-for="item in list" :key="item.id" @tap="$goTo('/pages/systemPay/nearby/goods/index',{id:item.id,storeId})">
				<view class="nearby-store-goods__item-img">
					<load-image mode="aspectFill" size="180rpx" :src="item.coverImg">
					</load-image>
				</view>
				<view class="nearby-store-goods__item-r e-m-l-20 e-flex-y e-flex-items-start e-flex-between e-flex-1">
					<view>
						<view class="e-line-2">
							{{ item.name }}
						</view>
						<view class="e-m-t-20 c-secondary e-font-24">
							<text>{{ $t('common.销量') }}</text>
							<text class="e-p-l-10">{{ $formatNumberToK(item.stockSold || 0) }}</text>
						</view>
					</view>
					<view class="e-flex e-flex-between">
						<view class="c-red">
							<text class="e-font-20">{{ $unitEn }}</text>
							<text class="e-font-28">{{ item.price }}</text>
						</view>
						<image src="../static/add.png" class="img-36" @tap.stop="$emit('getSku',item)"></image>
					</view>
				</view>
			</view>
			<load-more v-if="list.length" :showLoad="showLoad"></load-more>
		</scroll-view>
		
	</view>
</template>

<script>
export default {
	// #ifdef MP-WEIXIN
	// 将自定义节点设置成虚拟的，更加接近Vue组件的表现
	options: {
		virtualHost: true
	},
	// #endif
	props: {
		showLoad: Boolean,
		list: Array,
		storeId:String
	},
	data() {
		return {}
	}
}
</script>

<style lang="scss" scoped>
.nearby-store-goods {
	height: 100%;
	scroll-view {
		height: 100%;
	}
	&__item {
		border-radius: 0px 20rpx 0px 0px;
		margin-bottom: 2rpx;
		padding: 20rpx;
		&-img{
			flex: 0 0 180rpx;
			height: 180rpx;
		}
		&-r {
			height: 180rpx;
		}
	}
}

</style>
